/*
 * Copyright (c) 2009, Jan Pastor. All Rights Reserved.
 */

package sk.jp.jitag.vo.file;

import java.util.Set;
import java.awt.image.BufferedImage;
import java.awt.Dimension;

import sk.jp.imageio.jpeg.metadata.Tag;
import sk.jp.imageio.jpeg.metadata.Rating;
import sk.jp.imageio.jpeg.metadata.Info;
import sk.jp.imageio.jpeg.JpegImage;

/**
 * Jpeg image file.
 */
public class JpegImageFile extends ImageFile implements MediaFile, JpegImage {

    private final JpegImage jpegImage;

    //----------------------------------------------------------------------

    public JpegImageFile(JpegImage jpegImage) {
        super(jpegImage.getInfo());
        this.jpegImage = jpegImage;
    }

    //----------------------------------------------------------------------

    public Set<Tag> getTags() {
        return jpegImage.getTags();
    }

    public Rating getRating() {
        return jpegImage.getRating();
    }

    public Info getInfo() {
        return jpegImage.getInfo();
    }

    public boolean supportZoom() {
        return true;
    }

    public boolean supportRotation() {
        return true;
    }

    public void accept(MediaTypeVisitor visitor) {
        visitor.visit(this);
    }

    public BufferedImage getBufferedImage() {
        return jpegImage.getBufferedImage();
    }

    public BufferedImage getBufferedImage(Dimension dimension) {
        return jpegImage.getBufferedImage(dimension);
    }

    public BufferedImage getThumbnail(Dimension dimension) {
        return jpegImage.getThumbnail(dimension);
    }

    public void rotateLeft() {
        jpegImage.rotateLeft();
    }

    public void rotateRight() {
        jpegImage.rotateRight();
    }

    public void free() {
        jpegImage.free();
    }

}
